home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CICA Windows Explosion!
/
The CICA Windows Explosion! - Disc 2.iso
/
winsock
/
ircii2-6.zip
/
SRC\IRCII-2.6\DOC\TEST-SUI.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-12-28
|
555b
|
18 lines
/* To use this test program, compile it with "cc -otest-suid test-suid.c",
* change its ownership to root and mode 4711, and run it as a
* mortal user. IF the results show that it was able to set the
* EUID back to 0, you can use the PRIV_PORT_ULC version of the
* privileged port code, which is trivially proven to be secure.
*/
#include <stdio.h>
main()
{
printf("Starting EUID = %d\n", geteuid());
seteuid(getuid());
printf("After seteuid to %d is %d\n", getuid(), geteuid());
seteuid(0);
printf("After seteuid to 0 is %d\n", geteuid());
}